<h2>New Household</h2>

<% form_for :household, :url => { :action => 'create' } do |f| %>

<fieldset><legend><strong>Household Info</strong></legend>
<table border="0" cellspacing="1" cellpadding="1">

	<tr>
		<td>Last Name: </td>
		<td><%= f.text_field :name %><%= error_message_on('household', 'name') %></td>
	</tr>
	<tr>
		<td>Address: </td>
		<td><%= f.text_field :address1 %><%= error_message_on('household', 'address1') %></td>
	</tr>
	<tr>
		<td>Line 2: </td>
		<td><%= f.text_field :address2 %></td>
	</tr>
	<tr>
		<td>City: </td>
		<td><%= f.text_field :city %></td>
	</tr>
	<tr>
		<td>State: </td>
		<td><%= f.text_field :state, :size => 4 %> Zip: <%= f.text_field :zip, :size => 10 %><%= error_message_on('household', 'zip') %></td>
	</tr>
	
</table>
</fieldset>

<br>
<fieldset><legend><strong>Phones for this Household</strong></legend>
<div id="phones">
	<% @household.phones.each_with_index do |phone, index| %>
		<%= render :partial => 'phone_fields', :locals => { :phone => phone, :index => index } %>
	<% end %>
</div>
	<%= render :partial => "add_phone_link", :locals => { :index => @household.phones.size } %>
</fieldset>

<fieldset><legend><strong>Emails for this Household</strong></legend>
<div id="emails">
	<% @household.emails.each_with_index do |email, index| %>
		<%= render :partial => 'email_fields', :locals => { :email => email, :index => index } %>
	<% end %>
</div>
	<%= render :partial => "add_email_link", :locals => { :index => @household.emails.size } %>
</fieldset>

<fieldset><legend><strong>People In This Household</strong></legend>
   <div id="people">
   <% @household.people.each_with_index do |person, index| %>
     <%= render :partial => 'person_fields', :locals => { :person => person, :index => index } %>
   <% end %>
   </div>
   <%= render :partial => 'add_person_link', :locals => { :index => @household.people.size } %>
</fieldset>

   <p><%= submit_tag 'Create Household' %></p>
 <% end %>